import "../common/polyfill.js";
import render from "./render.js";
import bindEvent from  "./event.js";

//对外暴露一个函数
const login = ( opts = {}) =>{
    const defaultOpts = {
        loginBtnText: "登录",
        accountPlaceHolder: '手机号/邮箱/账号',
        accountLabel: '',
        passwordPlaceHolder: '请填写密码',
        passwordLabel: '',
        verifyPlaceHolder: '验证码',
        accountMax: '30',
        passwordMax: '30',
        showRemember: true,
        autocomplete: false,
    };
    //与默认参数合并(浅拷贝)
    const options = Object.assign(defaultOpts, opts);
    //console.log(options);
    render(options);
    bindEvent(options);
};
export { login };